<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>电子账册详情</title>
    <%@include file="/WEB-INF/pages/common/taglib.jsp" %>
    <%@include file="/WEB-INF/pages/common/common.jsp" %>
    <style type="text/css">
        .popover {
            max-width: 500px;
            width: auto;
        }
    </style>

</head>
<body style="overflow-x: hidden">
<form id="detailForm">
    <div class="row-fluid box">
        <div class="span12 box-header">
            <div class="title span12">
                <div style="float:left">
                    <i class="icon-edit" style="color: #00F;">
                    </i>
                    <strong>电子账册详情</strong>
                </div>
                <div style="float:right">
                    <button class="btn btn-primary btn-small" type="button" onclick="javascript:history.go(-1)">
                        <i class="icon-reply-all"></i>返回
                    </button>
                </div>
            </div>
        </div>
        <div class="span12 box-content">
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            账册编号
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.eBillingNo}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            预录入号
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.preNo}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            申报类型
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.decType}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            经营单位名称
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.enterpriseName}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            经营单位编码
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.enterpriseCode}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            联系人
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.contacts}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            电话
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.phone}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            企业注册资金
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.registeredCapital}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            贸易方式
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.tradeMode}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            批准证编号
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.approvalNo}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            设备金额
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.equipmentAmount}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            币制
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.currency}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            进口总额(USD)
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.imports}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            进口口岸一
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.inportOne}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            进口口岸二
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.inportTwo}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            结束有效期
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.expires}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            备案日期
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.decDate}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            备案内容
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.decContent}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            附表页数
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.decPages}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            申请人
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.decPerson}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            录入人
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.recordPerson}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            审核状态
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.decStatus}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            审核人
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.auditPerson}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="span3">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="titleCss100">
                            复审人
                        </td>
                        <td class="tdCss">
                            <input type="text"
                                   value="${tElectronicBilling.reviewPerson}">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="span12" style="margin-top: 10px">
            <div class='responsive-table'>
                <table id="tEBillingEquipment" style="height: 1px">
                </table>
                <%--<table id="orderBodyPage">--%>
                <%--</table>--%>
            </div>
        </div>
        <div class="span12" style="margin-top: 10px">
            <div class='responsive-table'>
                <table id="tEBillingMaterials" style="height: 1px">
                </table>
                <%--<table id="orderBodyPage">--%>
                <%--</table>--%>
            </div>
        </div>
        <div class="span12" style="margin-top: 10px">
            <div class='responsive-table'>
                <table id="tEBillingEndgood" style="height: 1px">
                </table>
                <%--<table id="orderBodyPage">--%>
                <%--</table>--%>
            </div>
        </div>
        <div class="span12" style="margin-top: 10px">
            <div class='responsive-table'>
                <table id="tEBillingConsumption" style="height: 1px">
                </table>
                <%--<table id="orderBodyPage">--%>
                <%--</table>--%>
            </div>
        </div>
    </div>
</form>
<script type="text/javascript">

    $(function () {
        function urlCodeMaterials(cellvalue, options, rowObject) {
            cellvalue = cellvalue || '';
            cellvalue = $.trim(cellvalue);

            var url = '${basePath}/eBilling/getTEBillingMaterialsDetail?seqNo=' + rowObject.seqNo + "&eBillingNo=${tElectronicBilling.eBillingNo}";
            return "<a class='btn-link' href=\"" + url + "\">" + "<span style='color:#00acec'>" + cellvalue + "</span></a>";
        }

        $("#tEBillingMaterials").jqGrid({
            datatype: "json",
            url: $basePath + "/eBilling/qryTEBillingMaterialsPage?eBillingNo=${tElectronicBilling.eBillingNo}",
            colNames: [
                '账册编号',
                '序号',
                '商品编码',
                '附加号',
                '商品名称'
            ],
            colModel: [
                {name: 'eBillingNo', index: 'eBillingNo', formatter: urlCodeMaterials},
                {name: 'seqNo', index: 'seqNo'},
                {name: 'goodsNo', index: 'goodsNo'},
                {name: 'addNo', index: 'addNo'},
                {name: 'goodsName', index: 'goodsName'}
            ],
            viewrecords: true,
            autowidth: true,
            height: 'auto',
            caption: '料件列表',
            shrinkToFit: false,
            autoScroll: true,
            rowNum: 10, //每页显示记录数
            rowList: [10, 20, 100], //可调整每页显示的记录数
            rownumWidth: 35,
            multiselect: true,
            width: $('body').width(),
            pager: "#tEBillingMaterialsPage", //分页工具栏
            loadComplete: function () {
                var rowNum = $(this).jqGrid('getGridParam', 'records');
                if (rowNum <= 0) {
                    if ($(this).parent().children('.norecords').length == 0)
                        $(this).parent().append("<div class=\"norecords\">暂无数据！</div>");
                    $(this).parent().children('.norecords').show();
                }
                else {//如果存在记录，则隐藏提示信息。
                    $(this).parent().children('.norecords').hide();
                }

                $("#tEBillingMaterials").setGridWidth($(window).width() - 2);
                $(".ui-jqgrid tr.ui-row-ltr td").css('text-align', 'center');
            }
        });
        function urlCodeEquipment(cellvalue, options, rowObject) {
            cellvalue = cellvalue || '';
            cellvalue = $.trim(cellvalue);

            var url = '${basePath}/eBilling/getTEBillingEquipmentDetail?seqNo=' + rowObject.seqNo + "&eBillingNo=${tElectronicBilling.eBillingNo}";
            return "<a class='btn-link' href=\"" + url + "\">" + "<span style='color:#00acec'>" + cellvalue + "</span></a>";
        }

        $("#tEBillingEquipment").jqGrid({
            datatype: "json",
            url: $basePath + "/eBilling/qryTEBillingEquipmentPage?eBillingNo=${tElectronicBilling.eBillingNo}",
            colNames: [
                '账册编号',
                '序号',
                '商品编码',
                '附加号',
                '商品名称'
            ],
            colModel: [
                {name: 'eBillingNo', index: 'eBillingNo', formatter: urlCodeEquipment},
                {name: 'seqNo', index: 'seqNo'},
                {name: 'hsCode', index: 'hsCode'},
                {name: 'addNo', index: 'addNo'},
                {name: 'goodName', index: 'goodName'}
            ],
            viewrecords: true,
            autowidth: true,
            height: 'auto',
            caption: '设备列表',
            shrinkToFit: false,
            autoScroll: true,
            rowNum: 10, //每页显示记录数
            rowList: [10, 20, 100], //可调整每页显示的记录数
            rownumWidth: 35,
            multiselect: true,
            width: $('body').width(),
            pager: "#tEBillingEquipmentPage", //分页工具栏
            loadComplete: function () {
                var rowNum = $(this).jqGrid('getGridParam', 'records');
                if (rowNum <= 0) {
                    if ($(this).parent().children('.norecords').length == 0)
                        $(this).parent().append("<div class=\"norecords\">暂无数据！</div>");
                    $(this).parent().children('.norecords').show();
                }
                else {//如果存在记录，则隐藏提示信息。
                    $(this).parent().children('.norecords').hide();
                }

                $("#tEBillingEquipment").setGridWidth($(window).width() - 2);
                $(".ui-jqgrid tr.ui-row-ltr td").css('text-align', 'center');
            }
        });
        function urlCodeEndGood(cellvalue, options, rowObject) {
            cellvalue = cellvalue || '';
            cellvalue = $.trim(cellvalue);

            var url = '${basePath}/eBilling/getTEBillingEndgoodDetail?seqNo=' + rowObject.seqNo + "&eBillingNo=${tElectronicBilling.eBillingNo}";
            return "<a class='btn-link' href=\"" + url + "\">" + "<span style='color:#00acec'>" + cellvalue + "</span></a>";
        }

        $("#tEBillingEndgood").jqGrid({
            datatype: "json",
            url: $basePath + "/eBilling/qryTEBillingEndgoodPage?eBillingNo=${tElectronicBilling.eBillingNo}",
            colNames: [
                '账册编号',
                '序号',
                '商品编码',
                '附加号',
                '商品名称'
            ],
            colModel: [
                {name: 'eBillingNo', index: 'eBillingNo', formatter: urlCodeEndGood},
                {name: 'seqNo', index: 'seqNo'},
                {name: 'hsCode', index: 'hsCode'},
                {name: 'addNo', index: 'addNo'},
                {name: 'goodName', index: 'goodName'}
            ],
            viewrecords: true,
            autowidth: true,
            height: 'auto',
            caption: '成品列表',
            shrinkToFit: false,
            autoScroll: true,
            rowNum: 10, //每页显示记录数
            rowList: [10, 20, 100], //可调整每页显示的记录数
            rownumWidth: 35,
            multiselect: true,
            width: $('body').width(),
            pager: "#tEBillingEndgoodPage", //分页工具栏
            loadComplete: function () {
                var rowNum = $(this).jqGrid('getGridParam', 'records');
                if (rowNum <= 0) {
                    if ($(this).parent().children('.norecords').length == 0)
                        $(this).parent().append("<div class=\"norecords\">暂无数据！</div>");
                    $(this).parent().children('.norecords').show();
                }
                else {//如果存在记录，则隐藏提示信息。
                    $(this).parent().children('.norecords').hide();
                }

                $("#tEBillingEndgood").setGridWidth($(window).width() - 2);
                $(".ui-jqgrid tr.ui-row-ltr td").css('text-align', 'center');
            }
        });
        function urlCodeConsumption(cellvalue, options, rowObject) {
            cellvalue = cellvalue || '';
            cellvalue = $.trim(cellvalue);

            var url = '${basePath}/eBilling/getTEBillingConsumptionDetail?seqNo=' + rowObject.seqNo + "&eBillingNo=${tElectronicBilling.eBillingNo}";
            return "<a class='btn-link' href=\"" + url + "\">" + "<span style='color:#00acec'>" + cellvalue + "</span></a>";
        }

        $("#tEBillingConsumption").jqGrid({
            datatype: "json",
            url: $basePath + "/eBilling/qryTEBillingConsumptionPage?eBillingNo=${tElectronicBilling.eBillingNo}",
            colNames: [
                '账册编号',
                '成品名称',
                '对应料件名称',
                '单耗',
                '损耗率'
            ],
            colModel: [
                {name: 'eBillingNo', index: 'eBillingNo', formatter: urlCodeConsumption},
                {name: 'goodsName', index: 'goodsName'},
                {name: 'consumptionName', index: 'consumptionName'},
                {name: 'consumption', index: 'consumption'},
                {name: 'lossRate', index: 'lossRate'}
            ],
            viewrecords: true,
            autowidth: true,
            height: 'auto',
            caption: '单耗列表',
            shrinkToFit: false,
            autoScroll: true,
            rowNum: 10, //每页显示记录数
            rowList: [10, 20, 100], //可调整每页显示的记录数
            rownumWidth: 35,
            multiselect: true,
            width: $('body').width(),
            pager: "#tEBillingConsumptionPage", //分页工具栏
            loadComplete: function () {
                var rowNum = $(this).jqGrid('getGridParam', 'records');
                if (rowNum <= 0) {
                    if ($(this).parent().children('.norecords').length == 0)
                        $(this).parent().append("<div class=\"norecords\">暂无数据！</div>");
                    $(this).parent().children('.norecords').show();
                }
                else {//如果存在记录，则隐藏提示信息。
                    $(this).parent().children('.norecords').hide();
                }

                $("#tEBillingConsumption").setGridWidth($(window).width() - 2);
                $(".ui-jqgrid tr.ui-row-ltr td").css('text-align', 'center');
            }
        });
        $("#detailForm input,textarea").attr("disabled", true);
    });


</script>
</body>
</html>
